using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WMS.WebApiRead.DTO
{
    /// <summary>
    /// 盘点信息详情结果DTO（包含主表信息、明细列表、附件列表）
    /// </summary>
    public class InventoryDetailResultDTO
    {
        /// <summary>
        /// 盘点ID
        /// </summary>
        public int InventoryId { get; set; }

        /// <summary>
        /// 盘点编号
        /// </summary>
        public string InventoryCode { get; set; }

        /// <summary>
        /// 盘点类型ID
        /// </summary>
        public int InventoryTypeId { get; set; }

        /// <summary>
        /// 盘点类型名称（联表查询得到）
        /// </summary>
        public string InventoryTypeName { get; set; }

        /// <summary>
        /// 仓库ID
        /// </summary>
        public int WarehouseId { get; set; }

        /// <summary>
        /// 仓库名称（联表查询得到）
        /// </summary>
        public string WarehouseName { get; set; }

        /// <summary>
        /// 处理人ID（经办人ID）
        /// </summary>
        public int HandlerrId { get; set; }

        /// <summary>
        /// 经办人名称（联表查询得到）
        /// </summary>
        public string HandlerName { get; set; }

        /// <summary>
        /// 部门ID（库管部门ID）
        /// </summary>
        public int? WarehouseDeptId { get; set; }

        /// <summary>
        /// 部门名称（联表查询得到）
        /// </summary>
        public string WarehouseDeptName { get; set; }

        /// <summary>
        /// 盘点时间
        /// </summary>
        public DateTime InventoryDateTime { get; set; }

        /// <summary>
        /// 结束盘点时间
        /// </summary>
        public DateTime InventoryEndTime { get; set; }

        /// <summary>
        /// 盘点内容
        /// </summary>
        public string InventoryContent { get; set; }

        /// <summary>
        /// 盘点数量
        /// </summary>
        public string? InventoryQuantity { get; set; }

        /// <summary>
        /// 盘盈数量
        /// </summary>
        public string? SurplusQuantity { get; set; }

        /// <summary>
        /// 盘亏数量
        /// </summary>
        public string? InventoryShortageQuantity { get; set; }

        /// <summary>
        /// 盘盈金额
        /// </summary>
        public string? SurplusAmount { get; set; }

        /// <summary>
        /// 盘亏金额
        /// </summary>
        public string? InventoryLossAmount { get; set; }

        /// <summary>
        /// 数据状态（1:草稿 2:已提交 3:审核中 4:已审核）
        /// </summary>
        public int DataStatus { get; set; }

        /// <summary>
        /// 制单人（创建人）
        /// </summary>
        public string? CreateName { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreateTime { get; set; }

        /// <summary>
        /// 修改人
        /// </summary>
        public string? UpdateName { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        public DateTime? UpdateTime { get; set; }

        /// <summary>
        /// 盘点明细列表
        /// </summary>
        public List<InventoryDetailItemDTO> DetailsList { get; set; } = new List<InventoryDetailItemDTO>();

        /// <summary>
        /// 附件列表
        /// </summary>
        public List<InventoryAttachmentDTO> AttachmentList { get; set; } = new List<InventoryAttachmentDTO>();

        /// <summary>
        /// 是否已删除
        /// </summary>
        public bool IsDeleted { get; set; }
    }

    /// <summary>
    /// 盘点明细项DTO
    /// </summary>
    public class InventoryDetailItemDTO
    {
        /// <summary>
        /// 盘点明细ID
        /// </summary>
        public int Inventory_check_detailsId { get; set; }

        /// <summary>
        /// 盘点编号
        /// </summary>
        public string InventoryCode { get; set; }

        /// <summary>
        /// 产品名称
        /// </summary>
        public string DetailsProductName { get; set; }

        /// <summary>
        /// 产品编码
        /// </summary>
        public string DetailsProductCode { get; set; }

        /// <summary>
        /// 规格型号
        /// </summary>
        public string SpecificationModel { get; set; }

        /// <summary>
        /// 单位
        /// </summary>
        public string DetailsUnit { get; set; }

        /// <summary>
        /// 账面库存
        /// </summary>
        public string BookStock { get; set; }

        /// <summary>
        /// 账面金额
        /// </summary>
        public string BookAmount { get; set; }

        /// <summary>
        /// 盘点数量
        /// </summary>
        public int CountedStock { get; set; }

        /// <summary>
        /// 盘点库位
        /// </summary>
        public string CountedStockLocation { get; set; }

        /// <summary>
        /// 原始盘点数量
        /// </summary>
        public string CountedStockRaw { get; set; }

        /// <summary>
        /// 数值化盘点数量
        /// </summary>
        public string CountedStockNumeric { get; set; }

        /// <summary>
        /// 盈亏数量
        /// </summary>
        public string ProfitLossQty { get; set; }

        /// <summary>
        /// 盈亏金额
        /// </summary>
        public string ProfitLossAmount { get; set; }

        /// <summary>
        /// 盈亏状态（0:盘亏 1:无盈亏 2:盘盈）
        /// </summary>
        public int Status { get; set; }

        /// <summary>
        /// 参考单价
        /// </summary>
        public string ReferencePrice { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }
    }

    /// <summary>
    /// 盘点附件DTO
    /// </summary>
    public class InventoryAttachmentDTO
    {
        /// <summary>
        /// 上传ID
        /// </summary>
        public int UploadId { get; set; }

        /// <summary>
        /// 盘点编号
        /// </summary>
        public string InventoryCode { get; set; }

        /// <summary>
        /// 上传地址（文件URL）
        /// </summary>
        public string UploadUrl { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreateTime { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        public string? CreateName { get; set; }
    }
}

